package com.song.uaa.gateway.service.dto;

import java.util.Set;
import java.util.stream.Collectors;

import com.song.uaa.gateway.domain.Authority;
import com.song.uaa.gateway.domain.User;

public class AdminUserDTO {
	
	private String id;
	
	private String login;
	
	private String name;
	
	private Set<String> authorities;
	
	public AdminUserDTO() {}
	
	public AdminUserDTO(User user) {
		this.id = user.getId();
		this.login = user.getLogin();
		this.name = user.getName();
		this.authorities = user.getAuthorities().stream().map(Authority::getName).collect(Collectors.toSet());
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public Set<String> getAuthorities() {
		return authorities;
	}

	public void setAuthorities(Set<String> authorities) {
		this.authorities = authorities;
	}
	
	
}
